package com.vencent.spring.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * simple demo for {@link com.vencent.spring.test.HomeControllerTest}
 * @author 1d
 *
 */
@Controller
@RequestMapping("/")
public class HomeController {
	
	/**
	 * model essence a map.
	 * if you don't declare the model or map , the spring will default provide this model.
	 * @param model
	 * @return
	 */
	@RequestMapping(method = RequestMethod.GET)
	public String home(Model model){
		return "/templates/home";
	}
	
	/**
	 * you can use array to mapping many path
	 * @return
	 */
	@RequestMapping(value={"myHome", "yourHome", "herHome"})
	public String personHome(){
		return "personHome";
	}
}
